package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "t_goods_cart", schema = "", catalog = "onedollar")
public class TGoodsCartEntity {
    private int id;
    private Integer userId;
    private Integer brandId;
    private Integer goodsId;
    private Integer enUserId;
    private Integer priceId;
    private Integer goodsNumber;
    private Integer recType;
    private Integer parentId;
    private Integer isGift;
    private Timestamp addTime;
    private Timestamp updateTime;
    private Integer status;
    private String memo;
    private String goodsAttr;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user_id", nullable = true, insertable = true, updatable = true)
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "brand_id", nullable = true, insertable = true, updatable = true)
    public Integer getBrandId() {
        return brandId;
    }

    public void setBrandId(Integer brandId) {
        this.brandId = brandId;
    }

    @Basic
    @Column(name = "goods_id", nullable = true, insertable = true, updatable = true)
    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    @Basic
    @Column(name = "en_user_id", nullable = true, insertable = true, updatable = true)
    public Integer getEnUserId() {
        return enUserId;
    }

    public void setEnUserId(Integer enUserId) {
        this.enUserId = enUserId;
    }

    @Basic
    @Column(name = "price_id", nullable = true, insertable = true, updatable = true)
    public Integer getPriceId() {
        return priceId;
    }

    public void setPriceId(Integer priceId) {
        this.priceId = priceId;
    }

    @Basic
    @Column(name = "goods_number", nullable = true, insertable = true, updatable = true)
    public Integer getGoodsNumber() {
        return goodsNumber;
    }

    public void setGoodsNumber(Integer goodsNumber) {
        this.goodsNumber = goodsNumber;
    }

    @Basic
    @Column(name = "rec_type", nullable = true, insertable = true, updatable = true)
    public Integer getRecType() {
        return recType;
    }

    public void setRecType(Integer recType) {
        this.recType = recType;
    }

    @Basic
    @Column(name = "parent_id", nullable = true, insertable = true, updatable = true)
    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    @Basic
    @Column(name = "is_gift", nullable = true, insertable = true, updatable = true)
    public Integer getIsGift() {
        return isGift;
    }

    public void setIsGift(Integer isGift) {
        this.isGift = isGift;
    }

    @Basic
    @Column(name = "add_time", nullable = true, insertable = true, updatable = true)
    public Timestamp getAddTime() {
        return addTime;
    }

    public void setAddTime(Timestamp addTime) {
        this.addTime = addTime;
    }

    @Basic
    @Column(name = "update_time", nullable = true, insertable = true, updatable = true)
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "status", nullable = true, insertable = true, updatable = true)
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Basic
    @Column(name = "memo", nullable = true, insertable = true, updatable = true, length = 200)
    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @Basic
    @Column(name = "goods_attr", nullable = true, insertable = true, updatable = true, length = 200)
    public String getGoodsAttr() {
        return goodsAttr;
    }

    public void setGoodsAttr(String goodsAttr) {
        this.goodsAttr = goodsAttr;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TGoodsCartEntity that = (TGoodsCartEntity) o;

        if (id != that.id) return false;
        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;
        if (brandId != null ? !brandId.equals(that.brandId) : that.brandId != null) return false;
        if (goodsId != null ? !goodsId.equals(that.goodsId) : that.goodsId != null) return false;
        if (enUserId != null ? !enUserId.equals(that.enUserId) : that.enUserId != null) return false;
        if (priceId != null ? !priceId.equals(that.priceId) : that.priceId != null) return false;
        if (goodsNumber != null ? !goodsNumber.equals(that.goodsNumber) : that.goodsNumber != null) return false;
        if (recType != null ? !recType.equals(that.recType) : that.recType != null) return false;
        if (parentId != null ? !parentId.equals(that.parentId) : that.parentId != null) return false;
        if (isGift != null ? !isGift.equals(that.isGift) : that.isGift != null) return false;
        if (addTime != null ? !addTime.equals(that.addTime) : that.addTime != null) return false;
        if (updateTime != null ? !updateTime.equals(that.updateTime) : that.updateTime != null) return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;
        if (memo != null ? !memo.equals(that.memo) : that.memo != null) return false;
        if (goodsAttr != null ? !goodsAttr.equals(that.goodsAttr) : that.goodsAttr != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        result = 31 * result + (brandId != null ? brandId.hashCode() : 0);
        result = 31 * result + (goodsId != null ? goodsId.hashCode() : 0);
        result = 31 * result + (enUserId != null ? enUserId.hashCode() : 0);
        result = 31 * result + (priceId != null ? priceId.hashCode() : 0);
        result = 31 * result + (goodsNumber != null ? goodsNumber.hashCode() : 0);
        result = 31 * result + (recType != null ? recType.hashCode() : 0);
        result = 31 * result + (parentId != null ? parentId.hashCode() : 0);
        result = 31 * result + (isGift != null ? isGift.hashCode() : 0);
        result = 31 * result + (addTime != null ? addTime.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (memo != null ? memo.hashCode() : 0);
        result = 31 * result + (goodsAttr != null ? goodsAttr.hashCode() : 0);
        return result;
    }
}
